const mysql = require('../db/mysql57');

const verificeDao = {
    // 查询用户卡密还有多少可用次数
    checkCardPasswordCount(id) {
        let sql = `select * from CardPassword where id = ? LIMIT 1`;
        let data = [ id ];
        return mysql.sqlExec(sql, data);
    },
    // 用户卡密使用次数加一
    cardPasswordCountInc(id) {
        let sql = `update CardPassword set count = count + 1 where id = ?`;
        let data = [ id ];
        return mysql.sqlExec(sql, data);
    },
};

module.exports = verificeDao;
